package calao.storage;

public final class StartCondition 
extends FieldCondition 
{

	final String prefix;

	public StartCondition(Field<String> field, String prefix)
	{
		super(field);
		this.prefix = prefix;
	}

	public boolean matches(Object value)
	{
		if (value==null) return false;
		try {
			return ((String)value).startsWith(prefix);
		}
		catch (ClassCastException e) {
			return false;
		}
	}
	
}
